<template>
	<view class="app-container">
		<earnings-component type="pay" :data="list"></earnings-component>
	</view>
</template>

<script>
	import {
		renewRecord
	} from '@/api/api.js'
	import EarningsComponent from '@/components/Earnings/Earnings.vue'
	export default {
		components: {
			EarningsComponent
		},
		data() {
			return {
				list: []
			};
		},
		onLoad() {
			this.init()
		},
		async onPullDownRefresh() {
			await this.init()
			uni.stopPullDownRefresh(); //停止刷新
		},
		methods: {
			init() {
				renewRecord({
					id: this.$store.state.user.id
				}).then(res => {
					if (res.code === 10000) {
						this.list = res.data
					}
				})
			}
		}
	}
</script>

<style lang="scss">

</style>